<template>
  <div class="c-minh c-bg-sgray">
    <!-- <div class="c-hh192 c-w100 bg theme-bg" ref="bg">
      <div class="c-pt24 c-ph24 c-w100 c-h">
        <div class="c-bg-white c-br-tl12 c-br-tr12 c-w100 c-h c-p">
          <img src="@/assets/i/wap/spread/hand.png" alt="" class="c-ww120 c-hh120 c-pa c-p-r0 c-p-t0">
          <div class="c-pa c-p-t0 c-p-l0 c-pt24 c-pl24 c-flex-row c-w100">
            <img :src="$addXossFilter(basic.headimgurl, require('@/assets/defult_head.png'))" alt="" class="c-ww120 c-hh120 c-brp50">
            <div class="c-pl16 c-pt12 c-w0 c-flex-grow1">
              <div class="c-fs30 c-fc-xblack c-text-ellipsis1">{{basic.nickname}}</div>
              <div class="c-pt12 c-flex-row c-justify-sb">
                <identity-com :vipType="basic.vipType"></identity-com>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div> -->
    <spread-money-temp :styleType="2"></spread-money-temp>
  </div>
</template>

<script>
import { utilJs } from "@/utils/common.js";
import SpreadMoneyTemp from "@/components/templates/spreadMoneyTemp.vue";
// import identityCom from "@/components/templates/common/identityCom.vue";
export default {
  name: "SpreadMoney",
  components: {
    SpreadMoneyTemp,
    // identityCom
  },
  props: [],
  data() {
    return {
      theme: localStorage.getItem("colorName") ? localStorage.getItem("colorName") : 'mb5_default',
      companyAuth: JSON.parse(localStorage.getItem("companyAuth")),
      basic: {},
      vipState: null,
    };
  },
  created() {
    utilJs.appShare(this);
  },
  mounted() {
  },
  computed: {},
  watch: {
    $route(to, from) {
      if (from.path == "/") {
        this.initData();
      }
    }
  },
  methods: {
    //获取基本信息
    getBaseInfo() {
      utilJs.getMethod(`${global.apiurl}promote/promoteUserInfo`, res => {
        this.basic = res.basic;
      });
    },
    initData() {
      this.getBaseInfo();
    },
    //分享
    wechatShare: function () {
      let shareUrl =
        window.location.href.split("#")[0] +
        "#" +
        this.$route.path +
        "?refereeId=" +
        localStorage.getItem("userId");
      utilJs.wechatConfig(shareUrl, "", "", "", function () { });
    },
    //手机端分享
    appShare: function () {
      let shareUrl =
        window.location.href.split("#")[0] +
        "#" +
        this.$route.path +
        "?refereeId=" +
        localStorage.getItem("userId");
      utilJs.appShareTrue("", "", shareUrl, "");
    },
  },
  activated() {
    let isiOS = navigator.userAgent.indexOf('IOSLogin') > -1 || navigator.userAgent.indexOf('IOSNewLogin') > -1 || navigator.userAgent.indexOf("IOSNewApp") > -1;
    setDocumentTitle(isiOS ? "分享" : "课程分享"); // eslint-disable-line
    if (utilJs.checkNeedInitData(this.spreadList)) {
      this.initData()
    }
    this.vipState = utilJs.getCustNameMap({1: '你还不是会员'});
    this.wechatShare();
  },
  deactivated() {
  }
};
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
.c-lhnor {
  line-height: normal;
}
.bg {
  background-image: url("../../../assets/i/wap/spread/bg.png");
  background-repeat: no-repeat;
  background-size: contain;
}
.hand {
  background: url("../../../assets/i/wap/spread/hand.png") no-repeat;
  background-size: contain;
}
.mt-140 {
  margin-top: -3.5rem;
}
.sticky {
  position: sticky;
  position: -webkit-sticky;
  top: 1.4rem;
}
.fixed {
  position: fixed;
  width: 100%;
  top: 0;
}
.minh800{min-height: 20rem;}
.vux-cell-box >>> .vux-cell-value {
  color: #333;
}
.search-bg {
  background: #f5f5f5;
}
.maxh125 {max-height:  3.125rem;}
</style>
